package com.wangyadong.hobby.schedule.jobtask.tree.example;

import com.wangyadong.hobby.schedule.jobtask.tree.Position;

import java.util.Iterator;

/**
 * <p>
 *
 * @author <714037465@qq.com>
 * @since 2018/10/812:57
 **/
public interface Tree<E> extends Iterable {

    int size();

    boolean isEmpty();

    boolean isRoot(Position position);

    boolean isExternal(Position position);

    boolean isInternal(Position position);

    Position<E> root();

    int childNum(Position position) throws IllegalArgumentException;

    Position<E> parent(Position position) throws IllegalArgumentException;


    Iterable<Position<E>> positions( );

    Iterable<Position<E>> child(Position position);



}
